package belf.migrate.engine.job.verify.utils;


import java.util.List;
import java.util.Locale;

public enum DMConventType {
    BIT(List.of("bit", "int"), "bit");


    private List<String> conventType;

    private String mappingType;


    DMConventType(List<String> conventType, String mappingType) {
        this.conventType = conventType;
        this.mappingType = mappingType;
    }

    public List<String> getConventType() {
        return conventType;
    }

    public void setConventType(List<String> conventType) {
        this.conventType = conventType;
    }

    public String getMappingType() {
        return mappingType;
    }

    public void setMappingType(String mappingType) {
        this.mappingType = mappingType;
    }

    public static boolean equals(String conventType, String mappingType) {
        for (DMConventType dmConventType : DMConventType.values()) {
            if (dmConventType.getConventType().contains(conventType.toLowerCase(Locale.ROOT)) && dmConventType.getMappingType().equalsIgnoreCase(mappingType)) {
                return true;
            }
        }
        return false;
    }

    public static boolean contains(String mappingType) {
        for (DMConventType dmConventType : DMConventType.values()) {
            if (dmConventType.getMappingType().equalsIgnoreCase(mappingType)) {
                return true;
            }
        }
        return false;
    }
}
